package com.welsy.util.treeRenderer {

 import mx.controls.treeClasses.*;
 import mx.collections.*;

 public class TreeTestRenderer extends TreeItemRenderer 
 {

	// Define the constructor.
	public function TreeTestRenderer() {
		super();
	}
	
	// Override the set method for the data property
	// to set the font color and style of each node.
	override public function set data(value:Object):void {
		if (value != null){
			super.data = value;
					
			var tmp:XML = new XML(TreeListData(super.listData).item);
			if (tmp.localName() == "answer"){		
				if(TreeListData(super.listData).item.@weight == "100") {
					setStyle("color", "#009900");
				}
				else if (TreeListData(super.listData).item.@weight == "0") {
					setStyle("color", "#ff0000");
				}
				else {
					setStyle("color", "#ffcc00");
				}
			}
		}
	}	
 }	
}